find common elements in three sorted arrays